﻿<Window x:Class="Ncmis.Client.Explorer.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    DataContext="{Binding RelativeSource={RelativeSource Self}}"
    Title="NCMIS Explorer" Height="500" Width="901" Loaded="Window_Loaded" Closing="Window_Closing">
    <Window.Resources>
        <SolidColorBrush x:Key="menuItemBrush" Color="#FF505050" />
    </Window.Resources>
    <Grid x:Name="mainGrid"
          Background="#FF505050">

        <Menu x:Name="mainMenu"
              Background="{DynamicResource menuItemBrush}"
              Grid.ColumnSpan="2"
              VerticalAlignment="Top">
            <!--File Menu-->
            <MenuItem x:Name="fileMenu"
                  Background="{DynamicResource menuItemBrush}"
                  Foreground="White"
                  Header="File">
                <MenuItem x:Name="fileMenuConnectMenuItem"
                          Header="Connect..."
                          Foreground="Black" />
                <MenuItem x:Name="fileMenuNewFolderMenuItem"
                          Click="fileMenuNewFolderMenuItem_Click"
                          Header="New Folder..."
                          Foreground="Black" />
                <MenuItem x:Name="fileMenuUploadFileMenuItem"
                          Click="fileMenuUploadFileMenuItem_Click"
                          IsEnabled="False"
                          Foreground="Black"
                          Header="Upload File..." />
                <Separator />
                <MenuItem
                    x:Name="fileMenuExitMenuItem"
                    Click="fileMenuExitMenuItem_Click"
                    Foreground="Black"
                    Header="Exit" />
            </MenuItem>
            <!-- Edit Menu -->
            <MenuItem x:Name="editMenu"
                      Background="{DynamicResource menuItemBrush}"
                      Foreground="White"
                      Header="Edit">
                <MenuItem x:Name="editMenuSettingsMenuItem"
                          Foreground="Black"
                          Header="Settings..." />
            </MenuItem>
            <!-- Help Menu -->
            <MenuItem x:Name="viewMenu"
                      Background="{DynamicResource menuItemBrush}"
                      Foreground="White"
                      Header="Help">
                <MenuItem x:Name="helpMenuAboutMenuItem"
                          Foreground="Black"
                          Header="About..." />
            </MenuItem>
        </Menu>
        <TabControl Margin="0,21,0,0" Name="mainTabControl" SelectionChanged="mainTabControl_SelectionChanged">
            <TabItem x:Name="propertiesTabItem"
                     Header="Properties" >
                <Grid x:Name="propertiesGrid">
                    <ListView Name="propertiesListView"
                              ItemsSource="{Binding Properties}"
                              Margin="6,6,0,24"
                              SelectionMode="Single">
                        <ListView.View>
                            <GridView AllowsColumnReorder="True">
                                <GridView.Columns>
                                    <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}" TextBlock.TextAlignment="Left" Width="160" />
                                    <GridViewColumn Header="Value" DisplayMemberBinding="{Binding Path=Value}" TextBlock.TextAlignment="Left" Width="260" />
                                </GridView.Columns>
                            </GridView>
                        </ListView.View>
                    </ListView>
                </Grid>
            </TabItem>
            <TabItem x:Name="CapabilitiesTabItem"
                     Header="Capabilities">
                <Grid x:Name="capabilitiesGrid">

                    <ListView Name="capabilitiesListView"
                              ItemsSource="{Binding Capabilities}"
                              Margin="6,6,0,24"
                              SelectionMode="Single">
                        <ListView.View>
                            <GridView AllowsColumnReorder="True">
                                <GridView.Columns>
                                    <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}" TextBlock.TextAlignment="Left" Width="160" />
                                    <GridViewColumn Header="Value" DisplayMemberBinding="{Binding Path=Value}" TextBlock.TextAlignment="Left" Width="260" />
                                </GridView.Columns>
                            </GridView>
                        </ListView.View>
                    </ListView>
                </Grid>
            </TabItem>
            <TabItem x:Name="typesTabItem"
                     Header="Types">
                <Grid>
                    <TreeView Margin="6,6,0,24" Name="typeCollectionTreeView" HorizontalAlignment="Left" Width="205" SelectedItemChanged="typeCollectionTreeView_SelectedItemChanged"
                              TreeViewItem.Expanded="treeViewItem_Expanded" />
                    <ListView Name="typesListView"
                              ItemsSource="{Binding TypeProperties}"
                              Margin="217,6,6,24"
                              SelectionMode="Single">
                        <ListView.View>
                            <GridView AllowsColumnReorder="True">
                                <GridView.Columns>
                                    <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}" TextBlock.TextAlignment="Left" Width="315" />
                                    <GridViewColumn Header="Value" DisplayMemberBinding="{Binding Path=Value}" TextBlock.TextAlignment="Left" Width="315" />
                                </GridView.Columns>
                            </GridView>
                        </ListView.View>
                    </ListView>
                </Grid>
            </TabItem>
            <TabItem x:Name="rootFolderTabItem"
                     Header="Root Folder">
                <Grid>
                    <TreeView Margin="6,6,0,24" Name="rootFolderTreeView" HorizontalAlignment="Left" Width="205" SelectedItemChanged="rootFolderTreeView_SelectedItemChanged" TreeViewItem.Expanded="treeViewItem_Expanded" AllowDrop="True" DragEnter="rootFolderTreeView_DragEnter" Drop="rootFolderTreeView_Drop" />
                    <ListView Margin="217,6,422,24" Name="selectedItemListView" ItemsSource="{Binding SelectedItemChildrenNames}" SelectionChanged="selectedItemListView_SelectionChanged" PreviewMouseLeftButtonDown="selectedItemListView_PreviewMouseLeftButtonDown" PreviewMouseMove="selectedItemListView_PreviewMouseMove">
                        <ListView.View>
                            <GridView AllowsColumnReorder="True">
                                <GridView.Columns>
                                    <GridViewColumn Header="Files" DisplayMemberBinding="{Binding Path=Name}" TextBlock.TextAlignment="Left" Width="223" />
                                </GridView.Columns>
                            </GridView>
                        </ListView.View>
                        <ListView.ContextMenu>
                            <ContextMenu>
                                <MenuItem x:Name="menuItemGetContent" Header="Get Content" Click="menuItemGetContent_Click" />
                                <MenuItem x:Name="menuItemDeleteFile" Header="Delete File" Click="menuItemDeleteFile_Click" />
                            </ContextMenu>
                        </ListView.ContextMenu>
                    </ListView>
                    <ListView Margin="0,6,6,24" Name="itemPropertieslistView" ItemsSource="{Binding SelectedItemChildrenProperties}" HorizontalAlignment="Right" Width="410">
                        <ListView.View>
                            <GridView AllowsColumnReorder="True">
                                <GridView.Columns>
                                    <GridViewColumn Header="Property ID" DisplayMemberBinding="{Binding Path=Name}" TextBlock.TextAlignment="Left" Width="200" />
                                    <GridViewColumn Header="Value" DisplayMemberBinding="{Binding Path=Value}" TextBlock.TextAlignment="Left" Width="200" />
                                </GridView.Columns>
                            </GridView>
                        </ListView.View>
                    </ListView>
                </Grid>
            </TabItem>
            <TabItem x:Name="searchTabItem"
                     Header="Search">
                <Grid>
                    <Label Height="28" HorizontalAlignment="Left" Margin="30,27,0,0" Name="queryLabel" VerticalAlignment="Top" Width="53">Query</Label>
                    <TextBox Height="23" Margin="89,27,0,0" Name="queryTextBox" VerticalAlignment="Top" HorizontalAlignment="Left" Width="700" />
                    <Button Height="23" HorizontalAlignment="Left" Margin="89,56,0,0" Name="searchButton" VerticalAlignment="Top" Width="75">Search</Button>
                    <ListView HorizontalAlignment="Left" Margin="6,100,0,24" Name="listView1" Width="250" />
                    <ListView Margin="262,100,6,24" Name="queryResultPropertieslistView" ItemsSource="{Binding SelectedItemChildrenProperties}">
                        <ListView.View>
                            <GridView AllowsColumnReorder="True">
                                <GridView.Columns>
                                    <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}" TextBlock.TextAlignment="Left" Width="200" />
                                    <GridViewColumn Header="Value" DisplayMemberBinding="{Binding Path=Value}" TextBlock.TextAlignment="Left" Width="200" />
                                </GridView.Columns>
                            </GridView>
                        </ListView.View>
                    </ListView>
                </Grid>
            </TabItem>
        </TabControl>
        <StatusBar Height="23" Name="mainStatusBar" VerticalAlignment="Bottom" Margin="0,1,0,0" BorderBrush="Gray" BorderThickness="0,1,0,0">
            <TextBlock Name="messageTextBlock">Not connected</TextBlock>
        </StatusBar>
    </Grid>
</Window>